import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

//引入element
import { Button,Carousel,CarouselItem,Pagination,Tabs,Dropdown,DropdownMenu,DropdownItem,Message} from 'element-ui';

Vue.use(Button).use(Carousel).use(CarouselItem).use(Pagination).use(Tabs).use(Dropdown).use(DropdownMenu).use(DropdownItem);

Vue.prototype.$message=Message




new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

router.beforeEach((to, from, next) => {    
  // chrome
  document.body.scrollTop = 0
  // firefox
  document.documentElement.scrollTop = 0
  // safari
  window.pageYOffset = 0
  next()
})